package com.nimitz.modules.demo.controller;

import com.nimitz.common.core.web.controller.BaseController;
import com.nimitz.common.core.web.page.TableDataInfo;
import com.nimitz.modules.demo.domain.DemoUser;
import com.nimitz.modules.demo.service.IDemoUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName DemoUserController
 * @Author Vincent
 * @Date 2021-08-19-17:02
 * @PackageName com.nimitz.modules.demo.controller
 * @Description 演示模块-用户控制层
 * @Version 1.0.0
 */
@RestController
@Api(tags = "用户管理")
@RequestMapping("/demo/user")
public class DemoUserController extends BaseController {

    @Autowired
    private IDemoUserService demoUserService;

    /**
     * 查询所有用户信息（含搜索）
     *
     * @param demoUser 用户信息
     * @return 用户信息集合
     */
    @GetMapping("/list")
    @ApiOperation(value = "查询所有用户信息（含搜索）")
    public TableDataInfo list(DemoUser demoUser) {
        startPage();
        List<DemoUser> demoUsers = demoUserService.selectDemoUserList(demoUser);
        return getDataTable(demoUsers);
    }
}
